<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'out.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
     <!-- 使用out标签输出常量 -->
     <c:out value="This is out first JSTL demo!"></c:out> <br>
     <!-- 使用out标签输出变量 -->
     <%session.setAttribute("name", "张三"); %>
     <!-- 直接输出变量值 -->
     <c:out value="${name}" ></c:out> <br>
     
     <!-- 当变量不存在时，通过default属性输出默认值 -->
     <c:out value="${name1}" default="error"></c:out><br>
     
     <!-- 设置输出转义后的字符需要escapeXml属性值设置为false -->
     <c:out value="&ltout标签&gt" escapeXml="false"></c:out>
  </body>
</html>
